package com.aaa.sbms.controller;

import com.aaa.sbms.service.QuitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("quit")
public class QuitController {

    @Autowired(required = false)
    private QuitService quitService;

    /**
     * 分页查询离职员工历史记录
     * @param map
     * @return
     */
    @RequestMapping("quitPage")
    public Map quitPage(@RequestParam Map map){
        return quitService.quitPage(map);
    }

    /**
     * 分页查询离职员工历史记录
     * @param map
     * @return
     */
    @RequestMapping("quitRecordPage")
    public Map quitRecordPage(@RequestParam Map map){
        return quitService.quitRecordPage(map);
    }

    /**
     * 查询一个离职申请
     * @param id
     * @return
     */
    @RequestMapping("quitOne")
    public Map quitOne(Integer id){
        return quitService.quitOne(id);
    }

    /**
     * 提交辞职申请
     * @return
     */
    @RequestMapping("addQuit")
    public Object addQuit(){
        return quitService.addQuit();
    }

    /**
     * 提交辞职申请
     * @return
     */
    @RequestMapping("pass")
    public Object pass(@RequestBody Map map){
        return quitService.pass(map);
    }
}
